<!DOCTYPE html>
<html lang="zh-CN">
	<head>
		<meta charset="UTF-8" />
		<meta name="viewport" content="width=device-width, initial-scale=1.0" />
		<title>window.onerror</title>
	</head>
	<body>
		<script src="https://javascript.info/article/script-async-defer/long123.js"></script>

		<script>
			// 全局错误处理程序

			window.onerror = function (msg, url, lineNo, columnNo, error) {
				console.log(`${msg} - ${url} - ${lineNo} - ${columnNo} - ${error}`)
			}
		</script>
	</body>
</html>
